#pragma once

class StackFrame
{
	friend BOOL __stdcall EnumSymbolCallback(PSYMBOL_INFO inf, ULONG size, PVOID param);
	HANDLE hProcess;
	STACKFRAME64& frame;
	std::vector<FunctionObject> m_parameters;
	std::string m_functionName;
	FunctionObject* m_returnType;
	std::string m_callConvention;
	std::string mFileName;
	ui32 mFileLine;

	void LoadParameters();
	void LoadCConv(PSYMBOL_INFO sym);

	void ParameterEnumProc(PSYMBOL_INFO sym);

	StackFrame(StackFrame& other) : frame(other.frame) { }
	void operator=(StackFrame&) { }

public:
	StackFrame(STACKFRAME64& stackFrame);
	~StackFrame()
	{
		delete m_returnType;
		m_parameters.clear();
	}

	std::string ToString();
};